afterPropertiesSet{
  String prefix=helper.getPrefix();
  if (template != null) {
    this.createObjects(prefix);
}
createObjects{
  Reflections reflections=new Reflections(new ConfigurationBuilder().filterInputsBy(new FilterBuilder.Include(FilterBuilder.prefix(prefix))).setUrls(ClasspathHelper.getUrlsForPackagePrefix(prefix)).setScanners(new SubTypesScanner(),new TypeAnnotationsScanner(),new ResourcesScanner()));
  Map<Class<?>,List<Class<?>>> depMap=new HashMap<Class<?>,List<Class<?>>>();
  for (  Class<?> clazz : reflections.getTypesAnnotatedWith(LODType.class)) {
    List<Class<?>> deps=new ArrayList<Class<?>>();
    for (    Field field : clazz.getDeclaredFields()) {
      if (field.isAnnotationPresent(LODProperty.class) && field.isAnnotationPresent(RelatedTo.class)) {
        deps.add(field.getType());
    depMap.put(clazz,deps);
  List<Class<?>> depList=new ArrayList<Class<?>>();
  Map<Class<?>,Integer> indexMap=new HashMap<Class<?>,Integer>();
  for (  Class<?> clazz : depMap.keySet()) {
    int index=findIndex(clazz,depMap) - 1;
    indexMap.put(clazz,index);
  ValueComparator comparator=new ValueComparator(indexMap);
  TreeMap<Class<?>,Integer> sortedIdexMap=new TreeMap(comparator);
  sortedIdexMap.putAll(indexMap);
  depList.addAll(sortedIdexMap.keySet());
  for (  Class<?> clazz : depList) {
    LODType lodType=clazz.getAnnotation(LODType.class);
    String endpoint=lodType.endpoint();
    String type=lodType.type();
    String namespace=lodType.namespace();
    String[] filters=lodType.filters();
    String limit=lodType.limit();
    String query=lodType.query();
    Map<String,String> fieldMap=new HashMap<String,String>();
    for (    Field field : clazz.getDeclaredFields()) {
      if (field.isAnnotationPresent(LODProperty.class)) {
        final LODProperty lodProperty=field.getAnnotation(LODProperty.class);
        String propertyRDFname=lodProperty.value();
        if (propertyRDFname.length() == 0) {
          propertyRDFname="property" + index;
        String fieldName=field.getName();
        fieldMap.put(propertyRDFname,fieldName);
      if (field.isAnnotationPresent(LODId.class)) {
      query=this.constructQuery(namespace,type,filters,limit,fieldMap);
        Object obj=clazz.newInstance();
        for (        Entry<String,Object> entry : resultMap.entrySet()) {
          String fieldName=entry.getKey();
          Object value=entry.getValue();
            if (!fieldName.equals(ID_NAME)) {
              String setterMethodName=createSetter(fieldName);
              Class<?> primitiveClass=getPrimitiveClass(value.getClass());
              Method setter=clazz.getMethod(setterMethodName,primitiveClass);
              String setterMethodName=createSetter(idField.getName());
              Method setter=clazz.getMethod(setterMethodName,String.class);
        String beanId=resultMap.get(ID_NAME).toString();
        factory.initializeBean(obj,beanId);
}
findIndex{
  int maxIndex=0;
    maxIndex=Math.max(findIndex(dep,depMap),maxIndex);
}
constructQuery{
  for (  String field : fieldMap.values()) {
  query+=" ?" + ID_NAME + " a "+ getFullName(type,namespace)+ "; ";
  for (  Entry<String,String> entry : fieldMap.entrySet()) {
    query+=getFullName(entry.getKey(),namespace) + " ?" + entry.getValue()+ "; ";
  if (filters.length > 0) {
    for (    String filter : filters) {
      query+=" ?" + ID_NAME + " = "+ getFullName(filter,namespace)+ " ||";
}
executeQuery{
  Query query=QueryFactory.create(queryString);
  QueryExecution qexec=QueryExecutionFactory.sparqlService(endpoint,query);
  ResultSet results=qexec.execSelect();
  while (results.hasNext()) {
    QuerySolution result=results.next();
    for (    String field : fields) {
      if (result.get(field) == null) {
        continue;
 else       if (result.get(field).isResource() && !field.equals(ID_NAME)) {
        Resource resource=null;
        try {
          resource=result.getResource(field);
 catch (        NullPointerException err) {
        try {
          if (resource != null) {
 catch (        Exception err) {
    Resource id=result.getResource(ID_NAME);
  qexec.close();
}
findDbValue{
  Field idField=null;
  for (  Field field : type.getDeclaredFields()) {
    if (field.isAnnotationPresent(LODId.class)) {
      idField=field;
}
getFullName{
    return "<" + namespace + name+ ">";
}
createSetter{
  return "set" + String.valueOf(fieldName.charAt(0)).toUpperCase() + fieldName.substring(1);
}
getPrimitiveClass{
  if (complex == Double.class) {
    return double.class;
  if (complex == Integer.class) {
    return int.class;
  if (complex == Long.class) {
    return long.class;
  if (complex == Float.class) {
    return float.class;
}
setApplicationContext{ }
ValueComparator{ }
compare{
  if ((Integer)base.get(a) >= (Integer)base.get(b)) {
}
